//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if compiler(>=5.5.2) && canImport(_Concurrency)

import SotoCore

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SupportApp {
    // MARK: Async API Calls

    /// Creates a Slack channel configuration for your Amazon Web Services account.    You can add up to 5 Slack workspaces for your account.   You can add up to 20 Slack channels for your account.    A Slack channel can have up to 100 Amazon Web Services accounts. This means that only 100 accounts can add the same Slack channel to the Amazon Web Services Support App. We recommend that you only add the accounts that you need to manage support cases for your organization. This can reduce the notifications about case updates that you receive in the Slack channel.  We recommend that you choose a private Slack channel so that only members in that channel have read and write access to your support cases. Anyone in your Slack channel can create, update, or resolve support cases for your account. Users require an invitation to join private channels.
    public func createSlackChannelConfiguration(_ input: CreateSlackChannelConfigurationRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> CreateSlackChannelConfigurationResult {
        return try await self.client.execute(operation: "CreateSlackChannelConfiguration", path: "/control/create-slack-channel-configuration", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Deletes an alias for an Amazon Web Services account ID. The alias appears in the Amazon Web Services Support App page of the Amazon Web Services Support Center. The alias also appears in Slack messages from the Amazon Web Services Support App.
    public func deleteAccountAlias(_ input: DeleteAccountAliasRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteAccountAliasResult {
        return try await self.client.execute(operation: "DeleteAccountAlias", path: "/control/delete-account-alias", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Deletes a Slack channel configuration from your Amazon Web Services account. This operation doesn't delete your Slack channel.
    public func deleteSlackChannelConfiguration(_ input: DeleteSlackChannelConfigurationRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteSlackChannelConfigurationResult {
        return try await self.client.execute(operation: "DeleteSlackChannelConfiguration", path: "/control/delete-slack-channel-configuration", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Deletes a Slack workspace configuration from your Amazon Web Services account. This operation doesn't delete your Slack workspace.
    public func deleteSlackWorkspaceConfiguration(_ input: DeleteSlackWorkspaceConfigurationRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteSlackWorkspaceConfigurationResult {
        return try await self.client.execute(operation: "DeleteSlackWorkspaceConfiguration", path: "/control/delete-slack-workspace-configuration", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Retrieves the alias from an Amazon Web Services account ID. The alias appears in the Amazon Web Services Support App page of the Amazon Web Services Support Center. The alias also appears in Slack messages from the Amazon Web Services Support App.
    public func getAccountAlias(_ input: GetAccountAliasRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetAccountAliasResult {
        return try await self.client.execute(operation: "GetAccountAlias", path: "/control/get-account-alias", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists the Slack channel configurations for an Amazon Web Services account.
    public func listSlackChannelConfigurations(_ input: ListSlackChannelConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListSlackChannelConfigurationsResult {
        return try await self.client.execute(operation: "ListSlackChannelConfigurations", path: "/control/list-slack-channel-configurations", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists the Slack workspace configurations for an Amazon Web Services account.
    public func listSlackWorkspaceConfigurations(_ input: ListSlackWorkspaceConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListSlackWorkspaceConfigurationsResult {
        return try await self.client.execute(operation: "ListSlackWorkspaceConfigurations", path: "/control/list-slack-workspace-configurations", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Creates or updates an individual alias for each Amazon Web Services account ID. The alias appears in the Amazon Web Services Support App page of the Amazon Web Services Support Center. The alias also appears in Slack messages from the Amazon Web Services Support App.
    public func putAccountAlias(_ input: PutAccountAliasRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> PutAccountAliasResult {
        return try await self.client.execute(operation: "PutAccountAlias", path: "/control/put-account-alias", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Registers a Slack workspace for your Amazon Web Services account. To call this API, your account must be part of an organization in Organizations. If you're the management account and you want to register Slack workspaces for your organization, you must complete the following tasks:   Sign in to the Amazon Web Services Support Center and authorize the Slack workspaces where you want your organization to have access to. See Authorize a Slack workspace in the Amazon Web Services Support User Guide.   Call the RegisterSlackWorkspaceForOrganization API to authorize each Slack workspace for the organization.   After the management account authorizes the Slack workspace, member accounts can call this API to authorize the same Slack workspace for their individual accounts. Member accounts don't need to authorize the Slack workspace manually through the Amazon Web Services Support Center. To use the Amazon Web Services Support App, each account must then complete the following tasks:   Create an Identity and Access Management (IAM) role with the required permission. For more information, see Managing access to the Amazon Web Services Support App.   Configure a Slack channel to use the Amazon Web Services Support App for support cases for that account. For more information, see Configuring a Slack channel.
    public func registerSlackWorkspaceForOrganization(_ input: RegisterSlackWorkspaceForOrganizationRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> RegisterSlackWorkspaceForOrganizationResult {
        return try await self.client.execute(operation: "RegisterSlackWorkspaceForOrganization", path: "/control/register-slack-workspace-for-organization", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Updates the configuration for a Slack channel, such as case update notifications.
    public func updateSlackChannelConfiguration(_ input: UpdateSlackChannelConfigurationRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UpdateSlackChannelConfigurationResult {
        return try await self.client.execute(operation: "UpdateSlackChannelConfiguration", path: "/control/update-slack-channel-configuration", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SupportApp {
    ///  Lists the Slack channel configurations for an Amazon Web Services account.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listSlackChannelConfigurationsPaginator(
        _ input: ListSlackChannelConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListSlackChannelConfigurationsRequest, ListSlackChannelConfigurationsResult> {
        return .init(
            input: input,
            command: self.listSlackChannelConfigurations,
            inputKey: \ListSlackChannelConfigurationsRequest.nextToken,
            outputKey: \ListSlackChannelConfigurationsResult.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  Lists the Slack workspace configurations for an Amazon Web Services account.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listSlackWorkspaceConfigurationsPaginator(
        _ input: ListSlackWorkspaceConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListSlackWorkspaceConfigurationsRequest, ListSlackWorkspaceConfigurationsResult> {
        return .init(
            input: input,
            command: self.listSlackWorkspaceConfigurations,
            inputKey: \ListSlackWorkspaceConfigurationsRequest.nextToken,
            outputKey: \ListSlackWorkspaceConfigurationsResult.nextToken,
            logger: logger,
            on: eventLoop
        )
    }
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
